<?php
namespace app\pc\controller;
use app\pc\model\BulletinBoard;
use think\Request;


//留言
class Contact extends Common
{
    
   public function postAddMessage(Request $request)
   {
       $data = $request->post();
//       $data=['real_name'=>'raeige','email'=>'ke@kk.cje','gender'=>'M','phone'=>'737726','address'=>'agriergre',
//          'context'=>'阿卡噶尔开口:k"<krkkk?kkooe)&kk%m卡佛了2#kk'
//       ];
       if(empty($data['real_name']) || empty($data['email']))
       {
           to_json_encode(400,'填写姓名 和邮箱',['status'=>false]);
       }
       if(empty($data['content']))
       {
           to_json_encode(400,'内容不能为空',['status'=>false]);
       }
       $record_id = BulletinBoard::addRecord($data);
       to_json_encode(200,'success',['status'=>true]);
   }


}
